Skip to content

Backport XML documentation for WebProxy and IWebProxyScript#124396

Open
Copilot wants to merge 6 commits intomainfrom
copilot/backport-xml-docs-webproxy
Open

Backport XML documentation for WebProxy and IWebProxyScript#124396
Copilot wants to merge 6 commits intomainfrom
copilot/backport-xml-docs-webproxy

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Description

Backports XML documentation from dotnet-api-docs for System.Net.WebProxy and System.Net.IWebProxyScript to their source implementations, per instructions in #124227.

Changes

System.Net.WebProxy.csproj - Updated project configuration:

  • Removed <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile> to enable compiler-generated XML documentation

WebProxy.cs - Added XML docs for:

  • Type-level documentation with comprehensive remarks on proxy configuration and WPAD support
  • All 11 constructors (parameterless, Uri-based, string-based, with bypass settings and credentials)
  • Serialization members: WebProxy(SerializationInfo, StreamingContext) constructor and GetObjectData method with PlatformNotSupportedException documentation
  • 6 properties: Address, BypassProxyOnLocal, BypassList, BypassArrayList, Credentials, UseDefaultCredentials
  • 3 methods: GetProxy, IsBypassed, GetDefaultProxy

IWebProxyScript.cs - Added XML docs for:

  • Type-level documentation
  • All interface methods: Close(), Load(), Run() with meaningful parameter descriptions and WPAD/PAC implementation details in remarks

All documentation uses proper C# XML conventions with <see langword="null"/> for keywords, <see cref="T:TypeName"/> for external type references, and simplified parameter descriptions. Documentation has been refined to:

  • Remove .NET Framework-centric content (application domain references)
  • Remove references to obsolete APIs (GlobalProxySelection)
  • Clarify .NET Framework-specific behavior where applicable
  • Remove incorrect exception documentation from auto-properties
  • Add proper exception documentation for serialization members that throw PlatformNotSupportedException
  • Replace placeholder "Internal only" parameter descriptions with meaningful documentation

Source:

Impact: 234 lines of documentation added across 3 files


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copilot AI changed the title [WIP] Backport XML docs for WebProxy and IWebProxyScript Backport XML documentation for WebProxy and IWebProxyScript Feb 13, 2026
Copilot AI requested a review from gewarren February 13, 2026 18:35
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Please also update the .csproj file to use the compiler generated XML docs as indicated in the instructions.

…descriptions, update IWebProxyScript remarks

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Please also update the .csproj file to use the compiler generated XML docs as indicated in the instructions.

Done in commit 0287cd0. Removed <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile> from the .csproj file and added XML documentation for the serialization members that were previously undocumented.

@gewarren gewarren marked this pull request as ready for review February 13, 2026 22:54
Copilot AI review requested due to automatic review settings February 13, 2026 22:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backports XML documentation from dotnet-api-docs for System.Net.WebProxy and System.Net.IWebProxyScript to their source implementations, following the pattern established in PR #124227. The documentation adds comprehensive API descriptions including type-level remarks, constructor documentation, property and method documentation with proper XML conventions.

Changes:

  • Removed UseCompilerGeneratedDocXmlFile property from the project file to enable compiler-generated XML documentation
  • Added comprehensive XML documentation for WebProxy class covering 11 constructors, 6 properties, and 3 methods including WPAD support details
  • Added XML documentation for IWebProxyScript interface covering all interface members with WPAD/PAC implementation details

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
src/libraries/System.Net.WebProxy/src/System.Net.WebProxy.csproj Removed UseCompilerGeneratedDocXmlFile property to enable compiler-generated documentation
src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs Added comprehensive XML documentation for class, constructors, properties, and methods (239 lines total)
src/libraries/System.Net.WebProxy/src/System/Net/IWebProxyScript.cs Added XML documentation for interface and all methods with WPAD/PAC details

Comment on lines 19 to 32
/// <param name="scriptLocation">Internal only.</param>
/// <param name="script">Internal only.</param>
/// <param name="helperType">Internal only.</param>
/// <returns>A <see cref="bool"/> indicating whether the script was successfully loaded.</returns>
bool Load(Uri scriptLocation, string script, Type helperType);

/// <summary>
/// Runs a script.
/// </summary>
/// <param name="url">Internal only.</param>
/// <param name="host">Internal only.</param>
/// <returns>
/// A <see cref="string"/>.
/// An internal-only value returned.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter descriptions "Internal only." and return value description "An internal-only value returned." are not helpful for API documentation. If these are truly internal-only, the type-level documentation should clarify the intended usage. Otherwise, provide meaningful descriptions of what these parameters and return values represent.

Suggested change
/// <param name="scriptLocation">Internal only.</param>
/// <param name="script">Internal only.</param>
/// <param name="helperType">Internal only.</param>
/// <returns>A <see cref="bool"/> indicating whether the script was successfully loaded.</returns>
bool Load(Uri scriptLocation, string script, Type helperType);
/// <summary>
/// Runs a script.
/// </summary>
/// <param name="url">Internal only.</param>
/// <param name="host">Internal only.</param>
/// <returns>
/// A <see cref="string"/>.
/// An internal-only value returned.
/// <param name="scriptLocation">
/// The URI that identifies the script to use for automatic proxy detection.
/// </param>
/// <param name="script">
/// The script content to load and prepare for execution.
/// </param>
/// <param name="helperType">
/// The type that provides helper methods or services available to the script at runtime.
/// </param>
/// <returns>A <see cref="bool"/> indicating whether the script was successfully loaded.</returns>
bool Load(Uri scriptLocation, string script, Type helperType);
/// <summary>
/// Runs a script.
/// </summary>
/// <param name="url">
/// The full destination URL for which proxy information is requested.
/// </param>
/// <param name="host">
/// The host name associated with the destination URL.
/// </param>
/// <returns>
/// A <see cref="string"/> that describes how to connect to the destination, such as a proxy configuration
/// directive (for example, <c>"DIRECT"</c> or <c>"PROXY host:port"</c>).

Copilot uses AI. Check for mistakes.
/// The <see cref="GetDefaultProxy"/> method returns an instance of the <see cref="WebProxy"/> class with the <see cref="Address"/>, <see cref="BypassProxyOnLocal"/>, and <see cref="BypassList"/> properties set to the values used by the local computer.
/// </para>
/// <para>
/// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GlobalProxySelection.Select property referenced here is obsolete (see line 31 issue). Consider updating this reference to use a non-obsolete API or removing this paragraph if it's no longer relevant.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
/// In .NET Framework, the <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
/// In modern .NET, this method is obsolete.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 5b2e4c9. Removed the entire paragraph referencing obsolete GlobalProxySelection.Select.

/// The <see cref="GetDefaultProxy"/> method returns an instance of the <see cref="WebProxy"/> class with the <see cref="Address"/>, <see cref="BypassProxyOnLocal"/>, and <see cref="BypassList"/> properties set to the values used by the local computer.
/// </para>
/// <para>
/// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
/// In .NET Framework, the <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
/// In modern .NET, this method is obsolete.

…lete API references, improve parameter descriptions

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants